<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">

		<title>CON-010: Production Control System [Selection]</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		
		<link rel="stylesheet" type="text/css" href="./css/custom.css">

	</head>

	<body>
		<f:view>
			<f:loadBundle var="bundle" basename="com.tpc.control.message.ResourceBundle"/>
			<h:form id="con010Form">
				<h:outputText value="Production Control System" styleClass="headerText"></h:outputText>	<br/>		
				<h:messages errorStyle="color: #FF0000; font-style: italic; font-weight: bold"/>
				<rich:panel style="width: 700px">
					<f:facet name="header">
						<h:outputText value="Common Data" />
					</f:facet>
					<h:panelGrid columns="4">
						<h:outputText value="Plant" />
						<h:inputText value="#{con010.plantFrom}" size="4" maxlength="4"/>
						<h:outputText value="to" />
						<h:inputText value="#{con010.plantTo}" size="4" maxlength="4"/>
						<h:outputText value="Division" />
						<h:inputText value="#{con010.divisionFrom}" size="2" maxlength="2"/>
						<h:outputText value="to" />
						<h:inputText value="#{con010.divisionTo}" size="2" maxlength="2"/>
						<h:outputText value="Production No." />
						<h:inputText value="#{con010.productionFrom}" size="12" maxlength="12"/>
						<h:outputText value="to" />
						<h:inputText value="#{con010.productionTo}" size="12" maxlength="12"/>
						<h:outputText value="Material" />
						<h:inputText value="#{con010.materialFrom}" size="18" maxlength="18"/>
						<h:outputText value="to" />
						<h:inputText value="#{con010.materialTo}" size="18" maxlength="18"/>
						<h:outputText value="Production Created Date" />
						<rich:calendar value="#{con010.createDateFrom}"
							datePattern="dd.MM.yyyy" locale="th_US" />
						<h:outputText value="to" />
						<rich:calendar value="#{con010.createDateTo}"
							datePattern="dd.MM.yyyy" locale="th_US" />
						<h:outputText value="Plan Start Date" />
						<rich:calendar value="#{con010.planStartDateFrom}"
							datePattern="dd.MM.yyyy" locale="th_US" />
						<h:outputText value="to" />
						<rich:calendar value="#{con010.planStartDateTo}"
							datePattern="dd.MM.yyyy" locale="th_US" />
					</h:panelGrid>
				</rich:panel>
				<a4j:outputPanel ajaxRendered="true" id="selectPanel">
					<rich:panel style="width: 700px">
						<f:facet name="header">
							<h:panelGroup>
								<h:selectBooleanCheckbox value="#{con010.selectSale}">
									<a4j:support event="onclick" reRender="selectPanel" actionListener="#{con010.selectSaleEvent}"></a4j:support>
								</h:selectBooleanCheckbox>
								<h:outputText value="Sales Data" />
							</h:panelGroup>
						</f:facet>
						<h:panelGrid columns="4">
							<h:outputText value="Customer No." />
							<h:inputText value="#{con010.customerFrom}" disabled="#{!con010.selectSale}" size="10" maxlength="10" />
							<h:outputText value="to" />
							<h:inputText value="#{con010.customerTo}" disabled="#{!con010.selectSale}" size="10" maxlength="10"/>
							<h:outputText value="Customer PO" />
							<h:inputText value="#{con010.customerPoFrom}" disabled="#{!con010.selectSale}" maxlength="35"/>
							<h:outputText value="to" />
							<h:inputText value="#{con010.customerPoTo}" disabled="#{!con010.selectSale}" maxlength="35"/>
							<h:outputText value="Sale Order No." />
							<h:inputText value="#{con010.saleOrderFrom}" disabled="#{!con010.selectSale}" size="10" maxlength="10"/>
							<h:outputText value="to" />
							<h:inputText value="#{con010.saleOrderTo}" disabled="#{!con010.selectSale}" size="10" maxlength="10"/>
							<h:outputText value="Sales Due-date" />
							<rich:calendar value="#{con010.saleDueDateFrom}" disabled="#{!con010.selectSale}"
								datePattern="dd.MM.yyyy" locale="th_US" />
							<h:outputText value="to" />
							<rich:calendar value="#{con010.saleDueDateTo}" disabled="#{!con010.selectSale}"
								datePattern="dd.MM.yyyy" locale="th_US" />
						</h:panelGrid>
					</rich:panel>
					<rich:panel style="width: 700px">
						<f:facet name="header">
							<h:panelGroup>
								<h:selectBooleanCheckbox value="#{con010.selectPir}">
									<a4j:support event="onclick" reRender="selectPanel" actionListener="#{con010.selectPirEvent}"></a4j:support>
								</h:selectBooleanCheckbox>
								<h:outputText value="PIR Data" />
							</h:panelGroup>
						</f:facet>
						<h:panelGrid columns="4">
							<h:outputText value="PIR No./PO Inter No." />
							<h:inputText value="#{con010.pirNoFrom}" disabled="#{!con010.selectPir}" size="10" maxlength="10"/>
							<h:outputText value="to" />
							<h:inputText value="#{con010.pirNoTo}" disabled="#{!con010.selectPir}" size="10" maxlength="10"/>
							<h:outputText value="PIR/PO Inter Due-Date" />
							<rich:calendar value="#{con010.pirDueDateFrom}" disabled="#{!con010.selectPir}"
								datePattern="dd.MM.yyyy" locale="th_US" />
							<h:outputText value="to" />
							<rich:calendar value="#{con010.pirDueDateTo}" disabled="#{!con010.selectPir}"
								datePattern="dd.MM.yyyy" locale="th_US" />
						</h:panelGrid>
					</rich:panel>
				</a4j:outputPanel>
				<h:panelGrid columns="3">
					<rich:panel>
						<f:facet name="header">
							<h:outputText value="Select Option Data" />
						</f:facet>
						<h:panelGrid columns="1">
							<h:selectOneRadio value="#{con010.option}" layout="pageDirection">
								<f:selectItem itemLabel="All Order" itemValue="a" />
								<f:selectItem itemLabel="Warning Order" itemValue="w" />
								<f:selectItem itemLabel="Open Order" itemValue="o" />
							</h:selectOneRadio>
						</h:panelGrid>
					</rich:panel>
					<rich:panel>
						<f:facet name="header">
							<h:outputText value="Select Height" />
						</f:facet>
						<h:panelGrid columns="1">
							<h:selectOneRadio value="#{con010.numRow}" layout="pageDirection">
								<f:selectItem itemLabel="#{bundle.display01}" itemValue="16" />
								<f:selectItem itemLabel="#{bundle.display02}" itemValue="28" />
								<f:selectItem itemLabel="#{bundle.display03}" itemValue="35" />
							</h:selectOneRadio>
						</h:panelGrid>
					</rich:panel>
					<h:panelGrid columns="1">
						<h:commandButton action="#{con010.selectField}"
							value="Select Field" />
						<h:commandButton action="#{con010.showReport}" value="Show Report" onclick=""/>
					</h:panelGrid>
				</h:panelGrid>
				
				<rich:modalPanel id="confirmProcess">
					<h:outputText value="#{bundle.message_error1}"/>
					<a href="javascript:Richfaces.hideModalPanel('confirmProcess')">Close</a>
				</rich:modalPanel>
				
			</h:form>
		</f:view>
	</body>
</html>